package org.fioma.tree;

import java.io.BufferedWriter;
import java.io.IOException;

public interface TreeHandler<L extends Label<L>, I extends InternalNode<L, I, F, N>, F extends LeafNode<L, I, F, N>, N extends Node<L, I, F, N>> {

	public I getOrCreateInternalNode(I node, L word);

	// create new internal node in the position pos
	public I createChild(I node, int pos, byte letter);

	public I createChildInternalNode(I node, L label);

	public F createChildLeaf(I node, L label);

	public F addWord(I node, L word);

	public void printWords(I node, BufferedWriter bw, String prefix) throws IOException;

	public boolean find(I node, L word);

	public N[] createChildrenNodes();
	// public NF getNodeFactory();
	//
	// public void setNodeFactory(NF nodeFactory);
}
